﻿using System.Drawing;

namespace UltrasoundTestingProject_Command.Helper
{
    /// <summary>
    /// 颜色转换帮助类
    /// </summary>
    public class ColorConvertHelper
    {
        public static List<Color> RgbFrom(List<double> values)
        {
            List<Color> colors = new List<Color>();

            for (int i = 0; i < values.Count; i++)
            {
                var number = values[i];
                byte r = (byte)(number % 256);
                byte g = (byte)((number / 256) % 256);
                byte b = (byte)((number / (256 * 256)) % 256);
                colors.Add(Color.FromArgb(r, g, b));
            }

            return colors;
        }
    }
}
